import { PayloadAction, createSlice } from "@reduxjs/toolkit"

interface AppointmentState {
  loader?: boolean
  locationLoader?: boolean
}

const initialState: AppointmentState = {
  loader: false,
  locationLoader: false,
}

const CreateAppointmentSlice = createSlice({
  name: "loadingSlice",
  initialState,

  reducers: {
    setLoader: (state, action) => {
      state.loader = action?.payload
    },

    setLocationLoader: (state, action) => {
      state.locationLoader = action?.payload
    },
  },
})

export default CreateAppointmentSlice.reducer
export const { setLoader, setLocationLoader } = CreateAppointmentSlice.actions
